<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<script>			
			// 1.将其他转成数字类型
			// 1.1.将String转成数字类型
			var message1 = "123";
			var num1 = Number(message1);
			console.log(num1, typeof num1);
			
			var message2 = "abc";
			var num2 = Number(message2);
			console.log(num2, typeof num2); // NaN
			
			// 1.2.将Boolean转成数字类型
			// true:1
			// false:0
			console.log(Number(true));
			console.log(Number(false));
			
			// 1.3.Undefined转成数字类型
			console.log(Number(undefined));//NaN
			
			// 1.4.Null转成数字类型
			console.log(Number(null));
		</script>
	</body>
</html>
